

<!doctype html>
<html ng-app="spicyApp2">
<head>
    <script src="http://code.angularjs.org/1.2.25/angular.min.js"></script>
</head>
<body>
<div ng-app="spicyApp2" ng-controller="SpicyCtrl">
    <input ng-model="customSpice">
    <button ng-click="spicy('chili')">Chili</button>
    <button ng-click="spicy(customSpice)">Custom spice</button>
    <p>The food is {{spice}} spicy!</p>
</div>
</body>
<script type="text/javascript">
    var myApp = angular.module('spicyApp2', []);

    myApp.controller('SpicyCtrl', ['$scope', function($scope){
        $scope.customSpice = "wasabi";
        $scope.spice = 'very';

        $scope.spicy = function(spice){
            $scope.spice = spice;
        };
    }]);
</script>
</html>

